<?php 
include_once('HttpClient.class.php'); 
include_once('core.php'); 
$user = $_POST["user"];
if(empty($user)){return;}
$code = $_POST["code"];
if(empty($code)){return;}
$data = $_POST["data"];
if(empty($data)){return;}
if(strpos($data,"rsid")==false){return;}
$sid = $_POST["sid"];
if(empty($sid)){return;}
$string = new String();
	$url ="/regsms/do_reg.jsp?sid=".$sid;
	$body="code=".$code.$data;
	$http = new HttpClient("pt.3g.qq.com");
	$http->settimeout(10);
	$http->setUserAgent("Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; SLCC2)/UCWEB7.4.0.57/31/999");
	$http->setreferer("http://pt.3g.qq.com/s?aid=nLogin3gqq&auto=1&s_it=1&g_f=286&sid=AbtK89EGYpaJmAu0MSgAlNAZ");
	$http->post($url,$body);
	$result = $http->getContent();
	$obj = null;
	$arr = array();
	$result = $string->Between($result,"<card title=\"注册QQ号码\">","<br/><br/>");
	if(strpos($result,"注册成功"))
	{
		$obj -> code = 0;
		$obj -> msg ="OK";
		$obj -> uin = $string->right($result,"您获得的QQ号码为：");	
	}
	else if(strpos($result,"验证码错误"))
	{
		$obj -> code = -1;
		$obj -> msg ="验证有误";
	}
	else 
	{
		$obj -> code = -999;
		$obj -> msg ="异常错误";
	}
	array_push($arr,$obj);
	echo json_encode($arr);
?>